import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView";
import MainView from "@/views/MainView";
import UserView from "@/views/UserView";
import PermissionView from "@/views/PermissionView";
import RoleView from "@/views/RoleView";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/main',
    name: 'main',
    component: MainView,
    children:[
      {
        path: '/user',
        name: 'user',
        component: UserView
      },
      {
        path: '/role',
        name: 'role',
        component: RoleView
      },
      {
        path: '/permission',
        name: 'permission',
        component: PermissionView
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
